/**   
 * @Title: SendCodeCommunicater.java 
 * @Package： com.esun.rabbit2.communicaters.myinfo 
 * @Description: 发送验证码
 * @Author Miko baoz@500wan.com   
 * @Date 2011-7-3 下午08:20:54  
 * Copyright (C) 2011 Shenzhen E-sun Sky Net Technology Co.,ltd.
 */
package com.esun.rabbit2.communicaters.myinfo;

import java.util.ArrayList;
import java.util.HashMap;

import com.esun.config.BussinessCode;
import com.esun.config.Key;
import com.esun.model.UserInfo;
import com.esun.network.ServerCommunicater;


/** 
* @ClassName: AuthCodeBindMobileCommunicater 
* @Description: 验证码绑定手机 
* @author: Liujun liuj@500wan.com
* @date: 2012-6-28 下午4:10:53 
*  
*/
public class AuthCodeBindMobileCommunicater extends ServerCommunicater {

	public boolean sendCode(String code, String num) {

		ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();

		list.add(mapItem(BussinessCode.PASER_MID, BussinessCode.MID_AUTHCODE_BIND_MOBILE));
		list.add(mapItem(BussinessCode.PASER_CK, UserInfo.getUserInfo().getUserSession()));
		list.add(mapItem(Key.KEY_CODE, code));
		list.add(mapItem(Key.KEY_MOBILENUM, num));

		try {
			super.getServerResponse(list, true);

			if (super.getState() == 100) {
				return true;
			} else {
				return false;
			}
		} catch (Exception e) {
			return false;
		}
	}

	private HashMap<String, String> mapItem(String name, String value) {
		HashMap<String, String> map = new HashMap<String, String>();
		map.put(name, value);
		return map;
	}

}
